package com.rb.dao;

import static org.junit.Assert.*;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"/applicationContext.xml"})
public class Auth_code {
	@Autowired
	private Auth_codeDAO auth_codeDAO;

	@Test
	public void test() {
		com.rb.model.Auth_code auth_code = auth_codeDAO.findAuthCodeByAccount("18752001905");
		assertEquals("5104", auth_code.getAuth_code());
		
	}
	@Test
	public void update(){
		com.rb.model.Auth_code auth_code = auth_codeDAO.findAuthCodeByAccount("18752001905");
		auth_code.setAuth_code("1235");
		int n = auth_codeDAO.updateByPrimaryKey(auth_code);
		assertEquals(1, n);
	}

}
